package cn.audit.service.log;

import cn.audit.bean.dto.UserCorrelation;
import cn.audit.bean.pojo.OperationLog;
import cn.audit.repository.log.OperationLogRepository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * @Author: 李忆枫
 * @Date: 2019/5/22 11:00
 */
@Service
public class OperationLogService {

    @Resource
    private OperationLogRepository operationLogRepository;

    /**
     * Aop添加日志
     *
     * @param operationLog
     */
    public void save(OperationLog operationLog) {
        operationLogRepository.save(operationLog);
    }

    /**
     * 查询日志
     *
     * @return
     */
    public Page<UserCorrelation> findLogAll(String name, String auditname, String module, String content, Pageable page) {
        return operationLogRepository.findLogAll(name, auditname, module, content, page);
    }


}
